package ar.com.photo_admin.persistence;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class TokenSQLiteHelper extends SQLiteOpenHelper {

	private static final String DATABASE_NAME = "Token.db";

	private static final int DATABASE_VERSION = 6;

	public static final String TOKEN_TABLE = "TASK";

	private static final String DATABASE_CREATE = "CREATE TABLE " + TOKEN_TABLE
			+ "(" + TokenColumns.ID_COLUMN.getName()
			+ " INTEGER PRIMARY KEY AUTOINCREMENT, "
			+ TokenColumns.TOKEN.getName() + " TEXT  NOT NULL, "
			+ TokenColumns.EVENT_ID.getName() + " INTEGER);";

	public TokenSQLiteHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(DATABASE_CREATE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int versionAnterior,
			int versionNueva) {
		db.execSQL("DROP TABLE IF EXISTS " + TOKEN_TABLE);
		onCreate(db);
	}
}